//
//  GameState.h
//  IssuesGame
//
//  Created by Martin Grider on 10/2/09.
//  Copyright 2009 Regents of the University of Minnesota
//

#import <Foundation/Foundation.h>
#import "Tile.h"


// TODO: Why can't I change this to the following without errors?
// @interface GameState : NSObject <NSXMLParserDelegate> {
@interface GameState : NSObject {

	int score;
	int playerX;
	int playerY;
	int playerPrevX;
	int playerPrevY;

	NSString *title;
	int size;
	
	NSString *imagePath;
	
	NSMutableArray *tiles;
	NSMutableDictionary *perspectives;
	NSMutableDictionary *perspectiveImages;
	
	NSString *currentElement;
	
	NSMutableDictionary *currentPerspective;
	NSMutableArray *currentAnswers;
	NSMutableDictionary *currentTile;
	
	BOOL askingQuestion;
}

@property (nonatomic) BOOL askingQuestion;
@property (nonatomic) int score;
@property (nonatomic) int playerX;
@property (nonatomic) int playerY;
@property (nonatomic) int playerPrevX;
@property (nonatomic) int playerPrevY;
@property (readonly) NSString *title;
@property (readonly) int size;
@property (readonly) NSMutableArray *tiles;
@property (readonly) NSMutableDictionary *perspectives;
@property (nonatomic, retain) NSMutableDictionary *perspectiveImages;
@property (readonly) NSString *imagePath;

- (id)initWithData:(NSData *)data;
- (id)initFromSavedGame;
- (void)save;
- (void)buildPerspectiveImages;
- (Tile *)tileAtCurrentPlayerLocation;
- (Tile *)tileAtRow:(int)row andColumn:(int)column;
- (int)indexOfRow:(int)row andColumn:(int)column;
- (BOOL)playerCanMoveUp;
- (BOOL)playerCanMoveDown;
- (BOOL)playerCanMoveLeft;
- (BOOL)playerCanMoveRight;

@end
